package org.orange.aicodeheloper.ai;

import dev.langchain4j.data.message.ImageContent;
import dev.langchain4j.data.message.TextContent;
import dev.langchain4j.data.message.UserMessage;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class AiCodeHelperTest {

    @Resource
    private AiCodeHelper aiCodeHelper;

    @Test
    void chat() {
        aiCodeHelper.chat("你好");

    }

    @Test
    void chatWithUserMessage() {
        UserMessage userMessage = UserMessage.from(
                TextContent.from("描述图片"),
                ImageContent.from("https://images.pexels.com/photos/33801362/pexels-photo-33801362.jpeg?cs=srgb&dl=pexels-ivan-aguilar-2154351719-33801362.jpg&fm=jpg&_gl=1*5lgfzb*_ga*MjA0Njk5MTU4Mi4xNzU3OTA4NDg5*_ga_8JE65Q40S6*czE3NTc5MDg0ODkkbzEkZzEkdDE3NTc5MDg0OTIkajU3JGwwJGgw")
        );
        aiCodeHelper.chat(userMessage);
    }
}